package co.yixiang.upms.common.system.feign;

import co.yixiang.common.core.api.ApiResult;
import co.yixiang.common.core.constant.ServiceNameConstants;
import co.yixiang.upms.common.system.hystrix.RemoteUserFallbackFactory;
import co.yixiang.upms.common.system.vo.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 用户服务
 *
 * @author yshop
 */
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService
{
    /**
     * 通过用户名查询用户信息
     *
     * @param username 用户名
     * @return 结果
     */
    @GetMapping(value = "/user/info/{username}",consumes="application/json", headers = {"Accept=application/json", "Content-Type=application/json"})
     ApiResult<UserInfo> getUserInfo(@PathVariable("username") String username);

    @GetMapping(value = "/user/info2/{phone}",consumes="application/json", headers = {"Accept=application/json", "Content-Type=application/json"})
    ApiResult<UserInfo> getUserInfoByPhone(@PathVariable("phone") String phone);
}
